<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/demo/carriercontract/carriercontract.jsx此处编写
 -->
<template>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
        :table="table" :extend="extend">
    </view-grid>
</template>
<script>
import extend from "@/extension/demo/carriercontract/carriercontract.jsx";
import { ref, defineComponent } from "vue";
export default defineComponent({
    setup() {
        const table = ref({
            key: 'CarrierContractId',
            footer: "Foots",
            cnName: '承运合同表',
            name: 'carriercontract/carriercontract',
            url: "/contract/api/carriercontract/",
            sortName: "CreateDate"
        });
        const editFormFields = ref({ "CarrierContractTitle": "", "Name": "", "CoordinationName": "", "LineName": "", "TonFreightPrice": "", "CharterTonnage": "", "CharterPrice": "", "HandlerName": "", "SignedDate": "", "CarrierContractPrice": "", "CarrierContractContent": "", "CarrierContractAlter": "", "CarrierContractText": "" });
        const editFormOptions = ref([[{ "title": "合同标题", "required": true, "field": "CarrierContractTitle", "type": "text" },
        { "dataKey": "承运单位下拉框", "data": [], "title": "承运单位", "required": true, "field": "Name", "type": "select" }],
        [{ "dataKey": "经办人下拉框", "data": [], "title": "承运负责人", "required": true, "field": "CoordinationName", "type": "select" },
        { "dataKey": "线路下拉框", "data": [], "title": "线路", "required": true, "field": "LineName", "type": "select" }],
        [{ "title": "吨运价", "required": true, "field": "TonFreightPrice", "type": "decimal" },
        { "title": "包车条件吨位", "field": "CharterTonnage", "type": "text" }],
        [{ "title": "包车金额", "field": "CharterPrice", "type": "text" },
        { "dataKey": "经办人下拉框", "data": [], "title": "经办人", "required": true, "field": "HandlerName", "type": "select" }],
        [{ "title": "签订日期", "required": true, "field": "SignedDate", "type": "datetime" },
        { "title": "合同金额", "field": "CarrierContractPrice", "type": "text" }],
        [{ "title": "合同标的或项目说明", "field": "CarrierContractContent", "colSize": 12, "type": "textarea" }],
        [{ "title": "合同主要条款/变更条款", "field": "CarrierContractAlter", "colSize": 12, "type": "textarea" }],
        [{ "title": "合同文本（附件）", "field": "CarrierContractText", "type": "file" }]]);
        const searchFormFields = ref({ "CarrierContractTitle": "", "Name": "", "CoordinationName": "", "SignedDate": "", "HandlerName": "", "CarrierContractState": "" });
        const searchFormOptions = ref([[{ "title": "合同标题", "field": "CarrierContractTitle", "type": "text" }, { "dataKey": "承运单位下拉框", "data": [], "title": "承运单位", "field": "Name", "type": "select" }, { "dataKey": "经办人下拉框", "data": [], "title": "承运负责人", "field": "CoordinationName", "type": "select" }], [{ "dataKey": "经办人下拉框", "data": [], "title": "经办人", "field": "HandlerName", "type": "select" }, { "title": "签订日期", "field": "SignedDate", "type": "datetime" }, { "dataKey": "审批状态下拉框", "data": [], "title": "状态", "field": "CarrierContractState", "type": "text" }]]);
        const columns = ref([{ field: 'CarrierContractId', title: '货主合同ID', type: 'string', width: 110, hidden: true, readonly: true, require: true, align: 'left' },
        { field: 'CarrierContractNumber', title: '合同编号', type: 'string', width: 150, align: 'left', sort: true },
        { field: 'CarrierContractTitle', title: '合同标题', type: 'string', width: 170, require: true, align: 'left' },
        { field: 'Name', title: '承运单位', type: 'string', bind: { key: '承运单位下拉框', data: [] }, width: 170, require: true, align: 'left' },
        { field: 'CoordinationName', title: '承运负责人', type: 'string', bind: { key: '经办人下拉框', data: [] }, width: 110, require: true, align: 'left' },
        { field: 'LineName', title: '线路', type: 'string', bind: { key: '线路下拉框', data: [] }, width: 110, require: true, align: 'left' },
        { field: 'TonFreightPrice', title: '吨运价', type: 'decimal', width: 110, require: true, align: 'left' },
        { field: 'CharterTonnage', title: '包车条件吨位', type: 'int', width: 110, align: 'left' },
        { field: 'CharterPrice', title: '包车金额', type: 'decimal', width: 110, align: 'left' },
        { field: 'SignedDate', title: '签订日期', type: 'datetime', width: 150, require: true, align: 'left', sort: true },
        { field: 'HandlerName', title: '经办人', type: 'string', bind: { key: '经办人下拉框', data: [] }, width: 110, require: true, align: 'left' },
        { field: 'CarrierContractPrice', title: '合同金额', type: 'decimal', width: 110, hidden: true, align: 'left' },
        { field: 'CarrierContractContent', title: '合同标的或项目说明', type: 'string', width: 120, hidden: true, align: 'left' },
        { field: 'CarrierContractAlter', title: '合同主要条款/变更条款', type: 'string', width: 120, hidden: true, align: 'left' },
        { field: 'CarrierContractText', title: '合同文本（附件）', type: 'string', width: 120, hidden: true, align: 'left' },
        { field: 'CreateName', title: '创建人', type: 'string', width: 110, hidden: true, align: 'left' },
        { field: 'CreateDate', title: '创建时间', type: 'datetime', width: 150, align: 'left', sort: true },
        { field: 'UpdateName', title: '修改人', type: 'string', width: 110, hidden: true, align: 'left' },
        { field: 'UpdateTime', title: '修改时间', type: 'datetime', width: 150, hidden: true, align: 'left', sort: true },
        { field: 'CarrierContractState', title: '状态', type: 'int', bind: { key: '审批状态下拉框', data: [] }, width: 110, align: 'left' },
        { field: 'ApprovalName', title: '审批人', type: 'string', width: 110, align: 'left' },
        { field: 'IsDel', title: '逻辑删除', type: 'int', width: 110, hidden: true, align: 'left' }]);
        const detail = ref({
            cnName: "#detailCnName",
            table: "#detailTable",
            columns: [],
            sortName: "",
            key: ""
        });
        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
        };
    },
});
</script>
